home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Enigma Amiga CD / Listati / 61-Febbraio-Esempio1.c < prev    next >
C/C++ Source or Header  |  1992-09-02  |  2KB  |  50 lines

  1. /*************************************************************************
  2. * Primo programma esempio di Impariamo a programmare l'Amiga (4)         *
  3. * creato da Giuseppe Ligorio                                             *
  4. * scopo: apre uno schermo con OpenScreenTags                             *
  5. *************************************************************************/
  6.  
  7. #define INTUI_V36_NAMES_ONLY
  8.  
  9. #include <exec/types.h>
  10. #include <intuition/intuition.h>
  11. #include <intuition/screens.h>
  12. #include <clib/exec_protos.h>
  13. #include <clib/dos_protos.h>
  14. #include <clib/intuition_protos.h>
  15.  
  16. /* puntatore alla base della librerie intuition.library */
  17. struct Library *IntuitionBase;
  18.  
  19. void main()
  20. {
  21.   struct Screen *schermo;   /* puntatore allo schermo */
  22.   UWORD penne[] = { ~0 };   /* informazioni minime sulle penne per ottenere il look 3D */
  23.   char att[40];             /* stringa per l'attesa */
  24.   
  25.   /* apertura intuition.library di versione 36 o superiore */
  26.   if ((IntuitionBase = OpenLibrary("intuition.library",36)) == NULL)
  27.   {
  28.     printf("Errore, non posso aprire libreria\n");
  29.     exit(0);
  30.   }
  31.   
  32.   /* apertura schermo con 2 bitplanes, penne per look 3D e titolo */
  33.   if ((schermo = OpenScreenTags(NULL,SA_Pens,(ULONG)penne,
  34.                                      SA_Depth,2,
  35.                                      SA_Title,"Primo schermo.",
  36.                                      TAG_DONE)) == NULL)
  37.   {
  38.     printf("Errore, non posso aprire lo schermo\n");
  39.     CloseLibrary(IntuitionBase);
  40.     exit(0);
  41.   }
  42.  
  43.   /* attesa inserimento stringa */
  44.   gets(att);
  45.  
  46.   /* chiusura schermo e libreria */
  47.   CloseScreen(schermo);
  48.   CloseLibrary(IntuitionBase);
  49. }
  50.